Overview
The 8080 has an 8-bit data bus and a 16-bit address bus allowing it to access 64 KiB of memory.
CPU Registers
| 15 8 | 7 0 |
| PSW | A | Flags |
| B | B | C |
| D | D | E |
| H | H | L |
| | SP |
| | PC |
The 8080 has 6 general purpose 8-bit registers (B, C, D, E, H, and L) that can be referenced as three 16-bit register pairs (B, D, and H). The Accumulator (A) is an additional 8-bit register with some special capabilities such as being used to updated condition flags. Some instructions allow A and the condition flags to be treated as a register pair called the Program Status Word (PSW).
There are also two special 16-bit registers. The Program Counter (PC) register holds the address of the next instruction to be executed. The Stack Pointer (SP) holds the address of the last value added to the stack.
Condition Flags
The 8080 has 5 flags that are set by various instructions.
Carry/Borrow
Set if a carry out occurs from an addition instruction or a borrow occurs from a subtraction.
Sign
Set based on the most-significant bit of the value in the accumulator to indicate the sign of the result.
0 - Positive
1 - Negative.
Zero
Set if the value in the accumulator is zero.
Parity
Set based on the parity of the value in the accumulator.
0 - Odd Parity
1 - Event Parity
Auxiliary Carry
Set if a carry out occurs from bit 3 of the accumulator. Used for Binary Coded Decimal instructions which treat the accumulator as two 4 bit values.
Stack Operations
The stack location is set by loading a value into SP and it expands downwards in memory. Items are added to and removed from the stack in 16-bit chunks.
Input/Output
Input and Output is handled using dedicated I/O ports. These I/O ports are separate from the address space meaning that there is no impact on the amount of memory that can be used. IO operations put the IO port on the address bus twice (The high byte of the address bus and the low byte of the address bus contain the same value) and then use the data bus lines to indicate that an input or output operation is in progress. The system needs to handle these signals to select between memory and IO devices
Memory-mapped IO can also be used by using the data access instructions and ignoring the IO instructions. This would limit the memory space.